package com.magic.zhixin.controller;

import com.magic.zhixin.entity.Result;
import com.magic.zhixin.entity.UserInfo;
import com.magic.zhixin.service.WeixinApiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "微信开放接口")
@RestController
@RequestMapping(value = "/api/weixin/apis")
public class WeixinApiController extends BaseController{
	@Resource
	private WeixinApiService weixinApiService;

	@ApiOperation(value = "获取小程序码")
	@PostMapping("/getwxacodeunlimit")
	public String getwxacodeunlimit(@RequestBody String body) {
		String fileKey = DigestUtils.md5Hex(body);

		return weixinApiService.getwxacodeunlimit(fileKey, body);
	}

}
